/*
 * Copyright (c) 2021. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
 * Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
 * Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
 * Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
 * Vestibulum commodo. Ut rhoncus gravida arcu.
 */

import java.util.Random;

/**
 * 随机生成一个 1 到 13 的整数（提示：使用随机机器.nextInt(13)+1），如果生成的是 1 到
 *   10 之间的数，就输出“电脑出了一张红桃几”，比如产生了一个 5 就输出“电脑出了一张红
 *   桃 5”，如果生成的是 11 就输出“电脑出了一张红桃 J”，如果生成的是 12 就输出“电脑出
 *   了一张红桃 Q”，如果生成是 13 就输出“电脑出了一张红桃 K”。
 */
public class HomeWork0312014 {
    public static void main(String[] args) {
        Random r = new Random();
        String[] types = {"红桃","黑桃","方块","梅花"};
        String[] nums = {"","A","2","3","4","5","6","7","8","9","10","J","Q","K"};
        for (int i=0;i<100;i++){
            int randomValue = r.nextInt(13)+1;
            int randomType = r.nextInt(4);
            System.out.format("randomValue=%s;randomType=%s,电脑出了一张%s%s\n"
                    ,randomValue
                    ,randomType
                    ,types[randomType]
                    ,nums[randomValue]
            );
        }
    }
}
